//
//  SearchDayRangeV.swift
//  ANOA
//
//  Created by 邱仙凯 on 2023/2/11.
//  Copyright © 2023 zwb. All rights reserved.
//   左边搜索框 右边日期的固定搜索

import UIKit
class SearchDayRangeV:RangeBaseV {
    override init(frame: CGRect) {
        super.init(frame: frame)
        
         startD = Date.todayPres(90)
         endD = Date.today
       

        startBtn.addTouchUpInSideAction { _ in
            let topViewController = RouterUtils.currentTopViewController()!

            self.showDateSelect(topViewController) { str in
                self.startD = str
 
                if let clo = self.startSearchClo {
                    clo(self.searchStr,self.startD,self.endD)
                }
            }
        }
        endBtn.addTouchUpInSideAction { _ in
            let topViewController = RouterUtils.currentTopViewController()!

            self.showDateSelect(topViewController) { str in
                self.endD = str
 
                if let clo = self.startSearchClo {
                    clo(self.searchStr,self.startD,self.endD)
                }
            }
        }
    }
    
    @MainActor required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
}
 
 
